import React, { Component } from 'react';
import "./Employeemanagement.scss"
import { Button } from 'antd-mobile'

const data = [
	{ num: '001', name: '鞠志锋', type: '安装员', year: 1 },
	{ num: '002', name: '鞠志锋', type: '安装员', year: 1 },
]
class Employeemanagement extends Component {
	constructor() {
		super()
		this.state = {
			index: 0
		}
	}
	componentDidMount() {
		document.getElementsByTagName('title')[0].innerHTML = '人员管理'
	}
	render() {
		let height = window.screen.height
		return (
			<div className="other-page OrderProgress performance" style={{ minHeight: height + 'px' }}>
				<div className='caption border-b'>
					<div>员工编号</div>
					<div>姓名</div>
					<div>类型</div>
					<div>年限</div>
				</div>
				<div className='content'>
					{
						data.map((item, index) => {
							return (
								<div
									className='item border-b'
									key={index}
									style={{ borderBottomWidth: index === data.length - 1 ? 0 : 1 }}
									onClick={() => {
										this.setState({
											index: index
										})
									}}>
									<img src={this.state.index === index ? require('../../images/dui.png') : require('../../images/unfouced.png')} alt='' />
									<div>{item.num}</div>
									<div>{item.name}</div>
									<div>{item.type}</div>
									<div>{item.year}</div>
								</div>
							)
						})
					}
				</div>
				<Button className='big-color-but'>增加</Button>
				<Button className='big-white-but' style={{ marginTop: 20 }}>删除</Button>
			</div>
		);
	}
}

export default Employeemanagement;